local skel = fk.CreateSkill {
  name = "efengqi__keji",
}

Fk:loadTranslationTable{
  ["efengqi__keji"] = "克己",
  [":efengqi__keji"] = "你弃置牌后，若包含【杀】，摸等量牌；若均为【杀】，改为摸两倍的牌。",

  ["$efengqi__keji1"] = "蓄力待时，不争首功。",
  ["$efengqi__keji2"] = "最好的机会，还在等着我。",
}

skel:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) then
      for _, move in ipairs(data) do
        if move.from == player and move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
          for _, info in ipairs(move.moveInfo) do
            if Fk:getCardById(info.cardId).trueName == "slash" then
              return true
            end
          end
        end
      end
    end
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local ids = {}
    for _, move in ipairs(data) do
      if move.from == player and move.toArea == Card.DiscardPile and move.moveReason == fk.ReasonDiscard then
        for _, info in ipairs(move.moveInfo) do
          table.insert(ids, info.cardId)
        end
      end
    end
    local n = #ids
    if table.every(ids, function (id)
      return Fk:getCardById(id).trueName == "slash"
    end) then
      n = 2 * n
    end
    player:drawCards(n, skel.name)
  end,
})



return skel
